package com.navinfo.data.esper.cep.linkid;

import com.espertech.esper.client.EventBean;
import com.espertech.esper.client.UpdateListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LinkidPatternListener  implements UpdateListener {
    public EventBean getLastEvent() {
        return lastEvent;
    }

    private EventBean lastEvent;

    public void update(EventBean[] newEvents, EventBean[] oldEvents) {
//        log.info("RatePatternListener======================================");
        if (newEvents != null) {
            for (int i = 0; i < newEvents.length; i++) {
                log.debug("=============+++++++++++++++++++++++b: " + ((TerminalLink) newEvents[i].get("b")).getTid());
            }
            lastEvent = newEvents[0];
        }
    }

    private static final Logger log = LoggerFactory.getLogger(LinkidPatternListener.class);
}
